package me.minecraft.woodenman.command;

import me.minecraft.woodenman.WoodenMan;
import me.minecraft.woodenman.config.Language;
import org.bukkit.command.CommandSender;

/**
 * @author langle__
 * @version 1.0
 */
public class StartCommand extends SubCommand {

    @Override
    public String getName() {
        return "start";
    }

    @Override
    public void onCommand(CommandSender sender, String[] args) {
        if (WoodenMan.gameTask == null) {
            sender.sendMessage(Language.NO_GAME_CREATED); // 使用 Language 中的常量
            return;
        }
        if (WoodenMan.playerLocation == null) {
            sender.sendMessage(Language.SPAWN_NOT_SET); // 使用 Language 中的常量
            return;
        }
        if (WoodenMan.woodenManLocation == null) {
            sender.sendMessage(Language.WOODENMAN_SPAWN_NOT_SET); // 使用 Language 中的常量
            return;
        }
        WoodenMan.gameTask.start();
        sender.sendMessage(Language.GAME_START);
    }

}
